<meta charset="UTF-8"><#include "common/common.html"/>
<table
	     class="easyui-datagrid"   
	     id="datagrid"  
         title="权限管理"  
         url="${base}/privilege/list"
         toolbar="#toolbar" 
         rownumbers="true" 
         fitColumns="true"
         singleSelect="true"
         data-options="fit:false,border:false,pageSize:20,pageList:[5,10,15,20]" >  
    <thead>  
        <tr>
            <th field="acl" width="5%" checkbox="true"></th>  
            <th field="name" width="15%">名字</th>
            <th field="url" width="20%">请求链接</th>   
            <th field="enname" width="15%">英文名</th>   
            <th field="sort" width="15%">显示顺序</th>   
            <th field="level" width="15%">级别</th>   
            <th field="ismenu" formatter="formatStatus" width="15%">是否菜单</th>   
        </tr>  
    </thead>  
</table>  
<div id="toolbar">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="javascript:openNewDlg('权限添加','privilege/doadd','privilege-dlg','privilege-fm');">添加</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="javascript:openEditDlg('权限修改','privilege/doupdate','privilege-dlg','privilege-fm');">修改</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="javascript:singleDel('privilege/delete');">删除</a>
</div>
<div id="privilege-dlg" class="easyui-dialog"  style="padding:10px 20px" closed="true" modal="true" buttons="#dlg-buttons">
        <form id="privilege-fm" method="post">
           <div class="fitem">
                <label>中文名:</label>
                <input id="name" name="name" maxlength="20" class="easyui-textbox" required="true">
           </div>
           <div class="fitem">
                <label>英文名:</label>
                <input id="enname" name="enname" maxlength="20" class="easyui-textbox">
           </div>
           <div class="fitem">
                <label>链&nbsp;接:</label>
                <input id="url" name="url" class="easyui-textbox">
           </div>
           <div class="fitem">
                <label>顺&nbsp;序:</label>
                <select class="easyui-combobox" name="sort" id="sort" style="width:165px;">
	                <option value="1">1</option>
	                <option value="2">2</option>
	                <option value="3">3</option>
	                <option value="4">4</option>
	                <option value="5">5</option>
	                <option value="6">6</option>
	                <option value="7">7</option>
	                <option value="8">8</option>
	                <option value="9">9</option>
	                <option value="10">10</option>
	                <option value="11">11</option>
	                <option value="12">12</option>
	                <option value="13">13</option>
	                <option value="14">14</option>
	                <option value="15">15</option>
	                <option value="16">16</option>
	                <option value="17">17</option>
	                <option value="18">18</option>
	                <option value="19">19</option>
	                <option value="20">20</option>
              </select>
           </div>
           <div class="fitem">
                <label>级&nbsp;别:</label>
               <input id="level" name="level" class="easyui-textbox" required="true">
           </div>
            <div class="fitem">
                <label>上级权限:</label>
                <input class="easyui-combobox" name="pacl" id="pacl" style="width:165px;"
			     data-options="
				    url:'${base}/role/initPrivilege',
				    method:'get',
				    valueField:'acl',
				    textField:'text',
				    panelHeight:'auto',
				    editable:false" required="true">
           </div>
            <div class="fitem">
                <label>是否菜单:</label>
                <select class="easyui-combobox" name="ismenu" id="ismenu" style="width:165px;" required="true">
	               <option value="1" selected="selected">是</option>
				   <option value="0">否</option>
              </select>
           </div>
        </form>
</div>
<div id="dlg-buttons">
    <a href="javascript:void(0)" id="saveBtn" class="easyui-linkbutton c6" iconCls="icon-ok" onclick="javascript:submit('privilege-dlg','privilege-fm')" style="width:90px">提交</a>
    <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#privilege-dlg').dialog('close')" style="width:90px">取消</a>
</div>

<script type="text/javascript">
function formatStatus(val){
	if (val == 1){
		return '是';
	} else {
		return '否';
	}
}
</script>
